
<form action="index.php?option=com_download" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
	<fieldset id="filter-bar">
            <table border='0' class="coach-search">
                <tr>
                    <td></td>
                    <td colspan="3" class="err">※印は入力必須項目です。</td>
                </tr>
               <tr>
                <td  class="text">ID</td>
                <td>
                <input type="text" name="jform[DOWI_CODE]" id="jformDOWI_CODE" value="<?php echo $this->id_DOWI; ?>" class="input_small" readonly="true" />
                </td>
               </tr>
               <tr>
                 <td class="text" >タイトル名<span style="color: red;font-size: small;font-family: 'ＭＳ Ｐゴシック', Osaka;">※</span></td>
                 <td><input type="text" name="jform[DOWI_NAME]" id="jformDOWI_NAME" value="<?php echo $this->data['DOWI_NAME']; ?>" class="input_small" /></td>
                  <td  class="td_medium">
                    
                </td>
               </tr>
               <tr>
                 <td class="text" style="vertical-align:top;line-height:30px" >添付ファイル</td>
                 <td>
                    <?php HelperBG::getLibUploadify(); ?>
                    <?php HelperBG::getUpload('jformDOWI_PATH', $this->data['DOWI_PATH'], 'uploads/files/com_download'); ?>
                   <!-- <input type="file" name="jformDOWI_PATH" id="jformDOWI_PATH" />-->
                 <td class="td_medium">
                 
                </td>
               </tr>
               <tr>
                <td class="text" >掲示カテゴリー</td>
                <td >
                <span id="select_cadm">
                    <select class="input_large" name="jform[DOWI_CADM_CODE]" id="jformDOWI_CADM_CODE">
                    <?php
                        foreach($this->list_cadm as $value){ 
                    ?>
                        <option value="<?php echo $value->CADM_CODE; ?>" <?php if($value==$this->data['DOWI_CADM_CODE']){ echo 'selected="selected"'; } ?> ><?php echo $value->CADM_NAME; ?></option>
                    <?php
                        }
                    ?>
                    </select>
                </span>
                    <input type="button" name="btnCREATE_CADM" id="btnCREATE_CADM" value="ダウンロードカテゴリ一覧管理" class="button" />
                </td>
               
               </tr>
               <tr>
                    <td class="text">説明</td>
                    <td>
                        <textarea name="jform[DOWI_DESCRIPTION]" id="jformDOWI_DESCRIPTION" cols="25" rows="4"><?php echo $this->data['DOWI_DESCRIPTION']; ?></textarea>
                    </td>
               </tr>
               
            </table>
	</fieldset>
	<div>
        
		<input type="hidden" name="task" value="" />
	</div>
</form>

<script>
jq(document).ready(function() {
        var zb;
        //show a dialog box: COCH search
        jq('#btnCREATE_CADM').bind('click', function(e) {
            e.preventDefault();
            zb = new jq.Zebra_Dialog('', {
                source:  {'ajax': 'index.php?option=com_download&views=bg&task=popup_cadm&tmpl=component'},
                height: 800,
                width: 600,
                title:  '',
                type:  '',
                buttons:  [
                    {caption: '閉じる', callback: function() { 
                        
                    }}
                        
                ],
                onClose: function(caption){
                    //ajax load cadm
                        var cadm_current = jq("#jformDOWI_CADM_CODE").val();
                    	var url = "index.php?option=com_download&task=loadCadm&cadm_current="+cadm_current;
                        
                        jq.get(url, function(data) {
                          jq('#select_cadm').html(data);
                        });
                        
                }
                
                               
            });
            
        });
        
        
});


</script>

